JavaScript Source

Check E-mail

In Russian
По русски



Main page

Software

Delphi

Perl

JavaScript

Sponsors

Favourites

Guestbook

About

Rated by PING
Rambler's Top100 Service

Click here to visit our sponsor
Free Advertising from Click2Net!

This section shows how to do a sample for a correct E-mail address entry.

Example:

Enter E-mail address:

*

Code inserted in heading HTML of page (before < /head >):

<script language="JavaScript">
<!--
function showerror(){
  alert("E-mail address is entered incorrectly.");
}
function checkmail(){
  txt=document.entermail.address.value;
  if (txt == "") {
    alert("Enter your E-mail address.");
    return(false)
  }
  if (txt.indexOf(".") == -1) {
   alert("Symbol \".\" is missed.");
   return(false)
  }
  dog = txt.indexOf("@");
  if (dog == -1) {
    alert("Symbol \"@\" is missed.");
    return(false)
  }
  if ((dog < 1) || (dog > txt.length - 5)) {
    showerror();
    return(false)
  }
  if ((txt.charAt(dog - 1) == '.') || (txt.charAt(dog + 1) == '.')) {
    showerror();
    return(false)
  }
}
// -->
</script>

</head>

Example of form code:

<form method="POST" name="entermail" onSubmit="return checkmail()">
<p><b><small>Введите E-mail адрес:<br>
</small></b><input type="text" name="address" size="20"><br>
<input type="submit" name="B1"> * <input type="reset" name="B2"></p>
</form>



    Check E-mail
    Pushing button
    Visitor's clock
    Format C:
    Frame Destroyer
    Computer name
    Custom link
    Following mouse
    SendMail without CGI
    Dynamic Graphics
    Dodge of the thieves
    You can always examine the HTML code of this or any other page and extract any scripts you find interesting. ;-)

    PING Banner Network